feat(mcp): Add job_type filtering support to list_cloud_sync_jobs#974
Conversation
This adds a job_type parameter to the list_cloud_sync_jobs MCP tool and its underlying API functions, allowing users to filter jobs by type: 'sync', 'reset', 'refresh', or 'clear'. Previously, the API defaulted to returning only sync and reset jobs, which prevented users from discovering stuck refresh or clear jobs. Changes: - api_util.get_job_logs(): Added job_type parameter - CloudConnection.get_previous_sync_logs(): Added job_type parameter - list_cloud_sync_jobs MCP tool: Added job_type parameter Closes #973 Co-Authored-By: AJ Steers <aj@airbyte.io>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Note 📝 PR Converted to Draft More info...Thank you for creating this PR. As a policy to protect our engineers' time, Airbyte requires all PRs to be created first in draft status. Your PR has been automatically converted to draft status in respect for this policy. As soon as your PR is ready for formal review, you can proceed to convert the PR to "ready for review" status by clicking the "Ready for review" button at the bottom of the PR page. To skip draft status in future PRs, please include |
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1770076982-add-job-type-filtering' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1770076982-add-job-type-filtering'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
📝 WalkthroughWalkthroughAdds an optional Changes
Sequence Diagram(s)sequenceDiagram
participant User as "User (MCP)"
participant MCP as "list_cloud_sync_jobs (MCP)"
participant Conn as "CloudConnection.get_previous_sync_logs"
participant Util as "api_util.get_job_logs"
participant API as "Airbyte API (jobs.list_jobs)"
User->>MCP: call list_cloud_sync_jobs(connection_id, job_type?)
MCP->>Conn: get_previous_sync_logs(connection_id, job_type?)
Conn->>Util: get_job_logs(connection_id, ..., job_type?)
Util->>API: jobs.list_jobs(ListJobsRequest{..., jobType=job_type})
API-->>Util: JobResponse list
Util-->>Conn: filtered JobResponse list
Conn-->>MCP: SyncJobListResult
MCP-->>User: result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Would you consider renaming the MCP tool to something like 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
job_type filtering support to list_cloud_sync_jobs
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
Devin, this is set to auto-merge and it will release in |
|
Done! I've created the coral-agents PR to bump the PyAirbyte dependency: https://github.com/airbytehq/coral-agents/pull/56 The constraint is updated to |
Summary
Adds
job_typefiltering support to thelist_cloud_sync_jobsMCP tool and its underlying API functions. This allows users to filter jobs by type:sync,reset,refresh, orclear.Previously, the Airbyte API defaulted to returning only sync and reset jobs when no
job_typewas specified, which prevented users from discovering stuck refresh or clear jobs via the API.Changes:
api_util.get_job_logs(): Addedjob_typeparameter with string-to-enum conversionCloudConnection.get_previous_sync_logs(): Addedjob_typeparameter pass-throughlist_cloud_sync_jobsMCP tool: Addedjob_typeparameter with descriptive help textCloses #973
Review & Testing Checklist for Human
job_typeparameter correctly filters jobs when tested against a real Airbyte Cloud connection (especially forrefreshandclearjob types)job_typevalue raises an appropriate error (currently relies onmodels.JobTypeEnumconstructor to raiseValueError)job_typemaintains backward compatibility (should return only sync/reset jobs per API default)Recommended test plan: Use the MCP tool test task to verify the parameter is correctly exposed:
poe mcp-tool-test list_cloud_sync_jobs '{"connection_id": "<test_connection_id>", "job_type": "refresh"}'Notes
Summary by CodeRabbit
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.